package w83a.w83aOperacionesPaso.w83aActas;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import w83a.w83aBeans.W83aActasBean;
import w83a.w83aUtilidadesComunes.W83aClsConstantes;

import es.ejie.frmk.presentacion.operacion.paso.Q70ActionPasoOP;
import es.ejie.frmk.presentacion.sesiondatos.Q70ContextoEJIE;

public class W83aGenericoOPAction extends Q70ActionPasoOP{

	
	protected void processOP(Q70ContextoEJIE contexto, ActionErrors errores, ActionMapping mapping,
			ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
		//Guardamos la accion en el contexto
		W83aActasBean acta=new W83aActasBean();
		String codSelec=(String)contexto.get("codSelec");
		String campos[]=codSelec.split("__");
		acta.setVersion(campos[3]);
		String numActa=campos[2];
		String camposActa[]=numActa.split("_");
		acta.setNumActaTerritorio(camposActa[0]);
		acta.setNumActa(camposActa[2]);
		acta.setNumActaAno(camposActa[1]);
		acta.setIdioma((String)contexto.get(W83aClsConstantes.CONSTANTE_CONTEXTO_IDIOMA));
		contexto.set("codSelec",codSelec);
		contexto.set("w83aNuevaActaBean",acta);
	}

	protected ActionForward processForward(Q70ContextoEJIE contexto, ActionErrors errors, ActionMapping mapping, 
			ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
		
		return mapping.findForward("ok");
	}
	

}